<cfsilent><!---

CF_Kalendar

COPYRIGHT & LICENSING INFO
-------------------------------------------------------------------

Copyright 2006 TJ Downes - tdownes@sanative.net - http://www.sanative.net

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

--->

<!--- attributes.view - defines which display mode to show: day, week, weeklist, month, condensed --->
<cfparam name="Attributes.view" type="string" default="list" />
<!--- attributes.categoryID - defines which category to pull in our recordset --->
<cfparam name="attributes.categoryID" type="numeric" default="0" />
<!--- attributes.linkDate - defines the starting date of our recordset --->
<cfparam name="Attributes.linkDate" type="date" default="#Now()#" />
<!--- attributes.eventRecords - an array of structs containing the recordset --->
<cfparam name="Attributes.eventRecords" type="array" default="0" />
<!--- attributes.CategoriesRS - a recordset of categories --->
<cfparam name="Attributes.CategoriesRS" type="query" />
<!--- attributes.ExcludeTimeHeader - boolean to specifiy if the header on the calendar for times is displayed --->
<cfparam name="Attributes.ExcludeTimeHeader" type="boolean" default="no" />
<!--- attributes.TooltipSubLength - the length to concatenate the Title string for the tooltips --->
<cfparam name="Attributes.TooltipSubLength" type="string" default="35" />
<!--- attributes.maxDescriptionSize - the length to concatenate the Description string for the tooltips --->
<cfparam name="Attributes.maxDescriptionSize" type="numeric" default="150" />
<!--- attributes.calendarLinkPage - the page that the user is taken to when they click an event --->
<cfparam name="Attributes.calendarLinkPage" type="string" default="" />
<!--- attributes.urlAddString - a URL string to add to the calendarLinkPage attribute --->
<cfparam name="Attributes.urlAddString" type="string" default="" />
<!--- attributes.includeDetailsUnderMiniCalendar - boolean specifying if the details of events are to be included under the condensed view. --->
<cfparam name="Attributes.includeDetailsUnderMiniCalendar" default="0" />
<!--- attributes.UnderMiniCalendarIncludePath - allows a developer to include a file under the condensed view. --->
<cfparam name="Attributes.UnderMiniCalendarIncludePath" type="string" default="" />
<!--- attributes.KalendarConfig  contains the configuration information for this instance of Kalendar. --->
<cfparam name="Attributes.KalendarConfig" type="any" />

</cfsilent>
<script type="text/javascript">
function changeWeek() {
	document.getElementById("weekSelector").submit();
}

function changeDay() {
	document.getElementById("daySelector").submit();
}

function changeDate() {
	document.getElementById("dateSelector").LinkDate.value = document.getElementById("dateSelector").LinkMonth.options[document.getElementById("dateSelector").LinkMonth.selectedIndex].value + "/1/" + document.getElementById("dateSelector").LinkYear.options[document.getElementById("dateSelector").LinkYear.selectedIndex].value;
	document.getElementById("dateSelector").submit();
}

function changeDate2() {
	document.getElementById("dateSelector2").LinkDate.value = document.getElementById("dateSelector2").LinkMonth.options[document.getElementById("dateSelector2").LinkMonth.selectedIndex].value + "/1/" + document.getElementById("dateSelector2").LinkYear.options[document.getElementById("dateSelector2").LinkYear.selectedIndex].value;
	document.getElementById("dateSelector2").submit();
}
</script>
<!--- examine the view passed and display the appropriate view tag --->
<cfswitch expression="#attributes.view#">
	<cfcase value="day">
		<cfmodule template="viewDay.cfm" attributecollection="#attributes#">
	</cfcase>

	<cfcase value="week">
		<cfmodule template="viewWeek.cfm" attributecollection="#attributes#" >
	</cfcase>

	<cfcase value="weeklist">
		<cfmodule template="viewWeekAsList.cfm" attributecollection="#attributes#" >
	</cfcase>

	<cfcase value="month">
		<cfmodule template="viewMonth.cfm" attributecollection="#attributes#" >
	</cfcase>

	<cfcase value="list">
		<cfmodule template="viewMonthCondensed.cfm" attributecollection="#attributes#" >
	</cfcase>
</cfswitch>
<!--- script that provides hover tooltips on calendars --->
<script type="text/javascript" src="<cfoutput>#attributes.KalendarConfig.getJavascriptPath()#</cfoutput>eventhover.js"></script>